package com.iplant.wms.service.po.mfs;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


@DBBasePO(TableName = "wms_store", CheckName = {"Code", "TypeID,Name"}, Schemas = DBSchemas.WMS, CodeAuto = true, CodePrefix = "CK-",Cache = true)
public class WMSStore extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 关联工厂列表  后续生产配料 生产入库需要同工厂关联
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> FactoryIDList = new ArrayList<>();

    @DBJoinMulti(Name = "Code", TableName = "fmc_factory", MainTableField = "FactoryIDList", Schemas = DBSchemas.Basic)
    public String FactoryCode = "";

    @DBJoinMulti(Name = "Name", TableName = "fmc_factory", MainTableField = "FactoryIDList", Schemas = DBSchemas.Basic)
    public String FactoryName = "";


    @DBCondition
    @DBField
    public int TypeID = 0;

    /**
     * 定义仓库类型枚举
     */
    @DBJoin(name="Name",tableName = "wms_store_type",tableAsName = "st1",Schemas = DBSchemas.WMS,MainTableField = "TypeID")
    public String TypeName = "";

    @DBField
    public List<Integer> ManagerID = new ArrayList<Integer>();

    @DBJoinMulti(Name = "Name", TableName = "mbs_user", MainTableField = "ManagerID")
    public String ManagerName = "";

    /**
     * 国家/地区
     */
    @DBField
    public String Country = "";

    /**
     * 省/市
     */
    @DBField
    public String Province = "";
    /**
     * 市/区
     */
    @DBField
    public String City = "";
    /**
     * 地址
     */
    @DBField
    public String Address = "";

    @JsonProperty("FactoryIDList")
    public List<Integer> getFactoryIDList() {
        return FactoryIDList;
    }

    public void setFactoryIDList(List<Integer> factoryIDList) {
        FactoryIDList = factoryIDList;
    }

    @JsonProperty("FactoryCode")
    public String getFactoryCode() {
        return FactoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        FactoryCode = factoryCode;
    }

    @JsonProperty("FactoryName")
    public String getFactoryName() {
        return FactoryName;
    }

    public void setFactoryName(String factoryName) {
        FactoryName = factoryName;
    }

    @JsonProperty("TypeID")
    public int getTypeID() {
        return TypeID;
    }

    public void setTypeID(int typeID) {
        TypeID = typeID;
    }

    @JsonProperty("TypeName")
    public String getTypeName() {
        return TypeName;
    }

    public void setTypeName(String typeName) {
        TypeName = typeName;
    }

    @JsonProperty("ManagerID")
    public List<Integer> getManagerID() {
        return ManagerID;
    }

    public void setManagerID(List<Integer> managerID) {
        ManagerID = managerID;
    }

    @JsonProperty("ManagerName")
    public String getManagerName() {
        return ManagerName;
    }

    public void setManagerName(String managerName) {
        ManagerName = managerName;
    }

    @JsonProperty("Country")
    public String getCountry() {
        return Country;
    }

    public void setCountry(String country) {
        Country = country;
    }

    @JsonProperty("Province")
    public String getProvince() {
        return Province;
    }

    public void setProvince(String province) {
        Province = province;
    }

    @JsonProperty("City")
    public String getCity() {
        return City;
    }

    public void setCity(String city) {
        City = city;
    }

    @JsonProperty("Address")
    public String getAddress() {
        return Address;
    }

    public void setAddress(String address) {
        Address = address;
    }
}
